import  java.util.Scanner;
public class Dataa{
  public static void main(String[] args){
    Scanner reader =new Scanner(System.in);
    int x=reader.nextInt();
    int a[]=new int [4];
    a[0]=(x/1000+9)%10;
    a[1]=(x/100%10+9)%10;
    a[2]=(x/10%10+9)%10;
    a[3]=(x%10+9)%10;
    int b=0;
    b=a[0];
    a[0]=a[2];
    a[2]=b;
    b=a[1];
    a[1]=a[3];
    a[3]=b;
    System.out.print("The encrypted number is ");
    for (int i=0;i<a.length;i++){
      System.out.print(a[i]);
    }
  }
}